using System;
using System.Text;

namespace ctsu.Admin.BusLogic
{

	public class Sample
	{
		private int _testID;
		private int _drawID;
		private int _protocol = 0;
		private object _tag;
		private ProtocolInfo _protocolInfo = null;
		private PatientInfo _patientInfo = null;
		private int _patientID = 0;
		//temp
		//private string _patient="";
		private string _mrn = "";
		private string _otherID = "";
		private string _patientName = "";
		private string _geneticID = "";
		private DateTime _batchInDate;
		private int _batchInNum;
		private DateTime _visitDate;
		private DateTime _recDate;
		private int _visitID;
		private int _specimenNum;

		//temp
		private string _visit = "";
		private int _testType = -1;
		private string _testName = "";
		private int _unitOfMeasure = -1;
		private string _unitOfMeasureName = "";
		private int _sampleType = -1;
		private string _sampleName = "";
		private string _location = "";
		private string _visitTime = "";
		private string _sampleVolume = "";
		private string _disposition = "";
		private bool _notUsed;
		private int _reasonNotUsed;
		private bool _noShow;
		private bool _isTestCheckOut;
		private bool _isGenetic;
		private bool _isLegacy;
		private DateTime _batchOutDate;
		private int _batchOutNum;
		private DateTime _outDate;
		private int _testOutTo = -1;
		private string _outToName;
		private string _outTo = "";
		private string _result = "";
		private string _note = "";
		private string _smallNote = "";

		public Sample()
		{
		}

		public override string ToString()
		{
			return this.DrawID.ToString();
		}

		public object Tag
		{
			get { return _tag; }
			set { _tag = value; }
		}

		public int TestID
		{
			get { return _testID; }
			set { _testID = value; }
		}

		public int DrawID
		{
			get { return _drawID; }
			set { _drawID = value; }
		}

		public int Protocol
		{
			get { return _protocol; }
			set { _protocol = value; }
		}

		public PatientInfo PatientInfo
		{
			get { return _patientInfo; }
			set { _patientInfo = value; }
		}

		public ProtocolInfo ProtocolInfo
		{
			get { return _protocolInfo; }
			set { _protocolInfo = value; }
		}

		public int PatientID
		{
			get { return _patientID; }
			set { _patientID = value; }
		}
		public string PatientName
		{
			get { return _patientName; }
			set { _patientName = value; }
		}
		public string MRN
		{
			get { return _mrn; }
			set { _mrn = value; }
		}
		public string OtherID
		{
			get { return _otherID; }
			set { _otherID = value; }
		}
		public string GeneticID
		{
			get { return _geneticID; }
			set { _geneticID = value; }
		}
		//		public string Patient
		//		{
		//			get{return _patient;}
		//			set{_patient=value;}
		//		}
		public DateTime BatchInDate
		{
			get { return _batchInDate; }
			set { _batchInDate = value; }
		}
		public int BatchInNum
		{
			get { return _batchInNum; }
			set { _batchInNum = value; }
		}
		public DateTime VisitDate
		{
			get { return _visitDate; }
			set { _visitDate = value; }
		}
		public DateTime ReceiveDate
		{
			get { return _recDate; }
			set { _recDate = value; }
		}
		public int VisitID
		{
			get { return _visitID; }
			set { _visitID = value; }
		}
		public int SpecimenNumber
		{
			get { return _specimenNum; }
			set { _specimenNum = value; }
		}
		public string Visit
		{
			get { return _visit; }
			set { _visit = value; }
		}
		public string SampleName
		{
			get { return _sampleName; }
			set { _sampleName = value; }
		}
		public int SampleType
		{
			get { return _sampleType; }
			set { _sampleType = value; }
		}
		public string TestName
		{
			get { return _testName; }
			set { _testName = value; }
		}
		public int TestType
		{
			get { return _testType; }
			set { _testType = value; }
		}

		public int UnitOfMeasure
		{
			get { return _unitOfMeasure; }
			set { _unitOfMeasure = value; }
		}

		public string UnitOfMeasureName
		{
			get { return _unitOfMeasureName; }
			set { _unitOfMeasureName = value; }
		}

		public string SampleVolume
		{
			get { return _sampleVolume; }
			set { _sampleVolume = value; }
		}

		public string Disposition
		{
			get { return _disposition; }
			set { _disposition = value; }
		}

		public string Location
		{
			get { return _location; }
			set { _location = value; }
		}

		public string VisitTime
		{
			get { return _visitTime; }
			set { _visitTime = value; }
		}
		public bool NotUsed
		{
			get { return _notUsed; }
			set { _notUsed = value; }
		}
		public int ReasonNotUsed
		{
			get { return _reasonNotUsed; }
			set { _reasonNotUsed = value; }
		}
		public bool IsTestCheckOut
		{
			get { return _isTestCheckOut; }
			set { _isTestCheckOut = value; }
		}
		public bool IsGenetic
		{
			get { return _isGenetic; }
			set { _isGenetic = value; }
		}
		public bool IsLegacy
		{
			get { return _isLegacy; }
			set { _isLegacy = value; }
		}
		public bool NoShow
		{
			get { return _noShow; }
			set { _noShow = value; }
		}
		public DateTime BatchOutDate
		{
			get { return _batchOutDate; }
			set { _batchOutDate = value; }
		}
		public int BatchOutNum
		{
			get { return _batchOutNum; }
			set { _batchOutNum = value; }
		}
		public DateTime OutDate
		{
			get { return _outDate; }
			set { _outDate = value; }
		}
		public int TestOutTo
		{
			get { return _testOutTo; }
			set { _testOutTo = value; }
		}
		public string OutToName
		{
			get { return _outToName; }
			set { _outToName = value; }
		}
		public string OutTo
		{
			get { return _outTo; }
			set { _outTo = value; }
		}
		public string Result
		{
			get { return _result; }
			set { _result = value; }
		}
		public string Note
		{
			get { return _note; }
			set { _note = value; }
		}
		public string SmallNote
		{
			get { return _smallNote; }
			set { _smallNote = value; }
		}
		public string GetNameOrIdentifier()
		{
			if (this._patientName.Length > 0)
				return _patientName;
			else if (_mrn.Length > 0)
				return _mrn;
			else return _otherID;
		}

		public string GetMrnOrOtherIdentifier()
		{
			if (_mrn.Length > 0)
				return _mrn;
			else return _otherID;
		}

		public string GetPatientToolTip()
		{
			return PatientInfo.GetToolTip();
		}

		public string GetDrawToolTip()
		{
			StringBuilder sb = new StringBuilder();
			sb.Append(ProtocolInfo.GetToolTip());
			sb.Append(Environment.NewLine);
			sb.Append(PatientInfo.GetToolTip());
			sb.Append(Environment.NewLine);
			sb.Append("Sample: " + SampleName);
			sb.Append(Environment.NewLine);
			sb.Append("  Visit: " + Visit);
			sb.Append(Environment.NewLine);
			sb.Append("  Visit Date: " + VisitDate.ToShortDateString());
			sb.Append(Environment.NewLine);
			sb.Append("  Visit Time: " + VisitTime);
			return sb.ToString();
		}
	}
}
